import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:38917
 * Date:2025/4/9
 * Time:22:23
 */
public class Solution {
    public static int majorityElement(int[] nums) {
        Arrays.sort(nums);
        return nums[nums.length/2];
    }
    //
    public static void main(String[] args) {
        int ret = majorityElement(new int[]{2,2,1,1,1,2,2});
        System.out.println(ret);
    }
}
